package com.suray.basic.wcs.plc.utils;

public enum ManualMode {
    CLOSE(0, "关闭"),
    LIFTER_UP(1, "提升机手动上升"),
    LIFTER_DOWN(2, "提升机手动下降"),
    CAR_DIR_1(3, "两向车1方向行驶"),
    CAR_DIR_2(4, "两向车3方向行驶"),
    PALLET_UP(5, "两向车手动上升"),
    PALLET_DOWN(6, "两向车手动下降")
    ;

    int value;
    String des;

    ManualMode(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static ManualMode parseStatus(int value) {
        for (ManualMode mode : ManualMode.values()) {
            if (mode.value == value) {
                return mode;
            }
        }

        throw new RuntimeException("手动模式转换出错：" + value);
    }

    @Override
    public String toString() {
        return des;
    }
}
